import { RouteRecordRaw } from 'vue-router';

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('layouts/MainLayout.vue'),
    children: [
      {
        path: '',
        name: 'template',
        component: () => import('pages/IndexPage.vue'),
      },
      {
        path: 'view',
        name: 'Layout',
        component: () =>
          import(
            /* webpackChunkName: "Layout" */ 'layouts/router-view/index.vue'
          ),
        children: [
          {
            path: '/dashboard/space',
            name: 'project',
            meta: {
              title: '分析页',
            },
            component: () =>
              import(
                /* webpackChunkName: "project" */ 'pages/dashboard/space/index.vue'
              ),
          },
          {
            path: '/dashboard/monitor',
            name: 'monitor',
            meta: {
              title: '监控页',
            },
            component: () =>
              import(
                /* webpackChunkName: "dashboard" */ 'pages/dashboard/monitor/index.vue'
              ),
          },
          {
            path: '/dashboard/workplace',
            name: 'workplace',
            meta: {
              title: '工作台',
            },
            component: () =>
              import(
                /* webpackChunkName: "report" */ 'pages/dashboard/workplace/index.vue'
              ),
          },
          // 表单页
          {
            path: '/form/BasicForm',
            name: '/form/BasicForm',
            component: () => import('pages/form/BasicForm/index.vue'),
          },
          {
            path: '/form/AdvancedForm',
            name: '/form/AdvancedForm',
            component: () => import('pages/form/AdvancedForm/index.vue'),
          },
          {
            path: '/form/StepForm',
            name: '/form/StepForm',
            component: () => import('pages/form/StepForm/index.vue'),
          },
          //系统管理页
          {
            path: '/tsystem/UserForm',
            name: '/tsystem/UserForm',
            component: () => import('pages/tsystem/UserForm/index.vue'),
          },
          {
            path: '/tsystem/PowerForm',
            name: '/tsystem/PowerForm',
            component: () => import('pages/tsystem/PowerForm/index.vue'),
          },
          {
            path: '/tsystem/BasicRole',
            name: '/tsystem/BasicRole',
            component: () => import('pages/tsystem/BasicRole/index.vue'),
            meta: {
              title: '角色管理',
            },
          },
          {
            path: '/goods/Category',
            name: '/goods/Category',
            component: () => import('pages/goods/Category/index.vue'),
            meta: {
              title: '商品分类管理',
            },
          },
        ],
      },
      // {
      //   path: '/form/StepForm',
      //   name: '/form/StepForm',
      //   component: () => import('layouts/router-view/index.vue'),
      //   children: [
      //     {
      //       path: '',
      //       component: () => import('pages/form/StepForm/index.vue'),
      //     },
      //   ],
      // },
    ],
  },

  {
    path: '/login',
    name: 'login',
    component: () => import('layouts/UserLayout.vue'),
    children: [
      {
        path: '',
        component: () => import('src/pages/user/login.vue'),
      },
    ],
  },

  // Always leave this as last one,
  // but you can also remove it
  {
    path: '/:catchAll(.*)*',
    component: () => import('pages/ErrorNotFound.vue'),
  },
];

export default routes;
